using System;
using System.Collections.Generic;
using System.Text;
using EYDIngenieria.ERP.ObjetosDeNegocio.Dominio;
using Castle.ActiveRecord;
using NHibernate.Expression;

namespace EYDIngenieria.ERP.ObjetosDeNegocio.Repositorio
{
   public class RepositorioDesglose
    {
        public void Agregar(Desglose o)
        {
           o.Create();
        }

        public Desglose[] Listar()
        {
           return ActiveRecordBase<Desglose>.FindAll();
        }

        public void Modificar(Desglose o)
        {
            o.UpdateAndFlush();
        }

        public void Eliminar(Desglose o)
        {
            o.DeleteAndFlush();
        }

       public Desglose[] BuscarPorAsiento(AsientoContable a)
       {
           return Desglose.FindAllByProperty("Fecha", "AsientoContable", a);
       }

       public Desglose Obtener(int id)
       {
           return Desglose.Find(id);
       }
    }
}
